﻿<template>
    <div id="myheader">
        <h1>
            <slot>管理系统</slot>
        </h1>
        <button @click="outLogin">退出登录</button>
    </div>
</template>

<script>
    import utils from "../utils/utils";
    export default {
        name: "myHeader",
        methods:{
            outLogin(){
                utils.setStorage('user','')
                this.$router.push('/login')
            }
        }

    }
</script>

<style lang="less" scoped>
    #myheader{
        padding: 10px 0;
        width: 100%;
        background-color:#2aabd2;
        position: relative;
        h1{
            text-align: center;
            color: white;
        }
        &:hover{
            cursor: pointer;
        }
        button{
            position: absolute;
            right: 20px;
            bottom: 20px;
        }
    }
</style>